//
//  GlobalConstansts.swift
//  MT
//
//  Created by zhang qiang on 2018/11/21.
//  Copyright © 2018年 张强. All rights reserved.
//

import Foundation
import UIKit
import DeviceKit

///  屏幕宽度
public let ScreenWidth : CGFloat = {
    return UIScreen.main.bounds.width
}()

/// 屏幕高度
public let ScreenHeight : CGFloat = {
    return UIScreen.main.bounds.height
}()

/// 当前机型是否是iPhoneX
public let IphoneXSeries : Bool = {
    
    return Device.realDevice(from: Device.current).isOneOf(Device.allXSeriesDevices)
}()

/// 屏幕顶部额外高度， iPhoneX 是24 其他为0
public let ScreenTopExtraOffset : CGFloat = {
    return IphoneXSeries ? 24.0 : 0.0
}()

/// 屏幕第部额外高度， iPhoneX 是34 其他为0
public let ScreenBottomExtraOffset : CGFloat = {
    return IphoneXSeries ? 34.0 : 0.0
}()


/// 导航栏高度
public let NavigationBarHeight : CGFloat = 44.0


/// 状态栏高度
public let StatusBarHeight : CGFloat = {
    return IphoneXSeries ? 44.0 : 20.0
}()


/// tab bar 高度
public let TabBarHeight : CGFloat = {
    return IphoneXSeries ? 83.0 : 49.0
}()


///  app 主要子视图距离屏幕边距
public let MainSubviewHorMargin = 20.0

/// app 主要页面背景颜色
public let MainPageBackgroundColor = UIColor.init(hex: 0xFFFFFF)


/// app 子视图主要背景颜色
public let MainSubviewBackgroundColor = UIColor.white


/// app 主要半透明背景颜色
public let MainTranslucentBackgroundColor = UIColor.init(hex: 0x000000, alpha: 0.6)

/// app 黄色主色
public let MainYellowColor : UIColor = {
    return UIColor.init(hex: 0xff8a00)
}()


/// app 主要浅黄色
public let MainLightYellowColor = UIColor.init(red: 255, green: 239, blue: 220)


/// app 主要分割线颜色
public let MainSeparatorLineColor : UIColor = {
    return UIColor.init(hex: 0xdfdfdf)
}()


/// app 主要 不可用状态下 文字和按钮颜色
public let MainDisableColor : UIColor = {
    return UIColor.init(hex: 0xbcbcbc)
}()


public let Main0x333333Color: UIColor = UIColor(hex: 0x333333)


public let MTApp_Version: String = Bundle.main.infoDictionary!["CFBundleShortVersionString"]! as! String

/// Notice View Y Offset
public let MTNoticeY: CGFloat = StatusBarHeight
